package project3.util;

import static java.lang.System.out;
import static java.lang.System.err;

import java.util.Arrays;
import java.util.List;

import project3.association.AssociationRule;
import project3.association.ItemSet;
import project3.association.RuleToString;

/**
 * Simple logger.
 *
 * @author Vika
 * @author Antonio
 */
public class Trace {

	public static void info(String message) {
		out.println(message);
	}

	public static void infoItemSets(List<ItemSet> singletons) {
		for (ItemSet singleton : singletons) {
			out.println(singleton);
		}
	}
	
	public static void infoRules(RuleToString ruleToString, AssociationRule... rules) {
		infoRules(ruleToString, Arrays.asList(rules));
	}

	private static void infoRules(RuleToString ruleToString, List<AssociationRule> rules) {
		out.println("Rules: ");
		for(AssociationRule rule : rules) {
			out.println(ruleToString.toString(rule));
		}
	}

	public static void infoRules(List<AssociationRule> rules) {
		out.println("Rules: ");
		for(AssociationRule rule : rules) {
			out.println(rule);
		}
	}

	public static void warning(String message) {
		err.println(message);
	}

}
